package com.util.thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author xin.ding
 * @date 2020/10/31 16:13
 */
public class ExceptionThread implements Runnable {
    @Override
    public void run() {
        System.out.println("sub thread start");
        throw new RuntimeException();
    }

    public static void main(String[] args) {
        System.out.println("main start");
        ExecutorService service = Executors.newCachedThreadPool();
        try {

            service.execute(new ExceptionThread());
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println("main end");




    }
}